<div id="list">
<?php if (count($categoria_list)): ?>
<table class="paginacao" cellpadding="2" cellspacing="0" width="100%" align="center">
	<tr>
		<td align="left"><?php $pager_layout->displayResultados(); ?></td>
		<td align="right"><?php $pager_layout->display(array('nourl'=>true)); ?></td>
	</tr>
</table>
<?php endif; ?>

<table class="list">
	<thead>
    <tr>
	    <th><?php echo $form['id_categoria']->renderLabel() ?></th>
	    <th><?php echo $form['nm_categoria']->renderLabel() ?></th>
	    <th><?php echo $form['id_categoria_pai']->renderLabel() ?></th>
	    <th><?php echo $form['ds_categoria']->renderLabel() ?></th>
	    <th><?php echo $form['slug']->renderLabel() ?></th>
		<th>Ações</th>
    </tr>
	</thead>
  	<tbody>
  	<?php if (!count($categoria_list)): ?>
	<tr>
		<td align="center" colspan="6">NENHUM REGISTRO ENCONTRADO!</td>
	</tr>
	<?php endif; ?>
	<?php $i = 0; ?>
    <?php foreach ($categoria_list as $categoria): ?>
    <?php $bg = ($i++ % 2 == 0)? 'row0' : 'row1'; ?>
    <tr class="<?php echo $bg; ?>">
	    <td><a href="<?php echo url_for('categoria/edit?id_categoria='.$categoria['id_categoria']) ?>"><?php echo $categoria['id_categoria'] ?></a></td>
		<td><?php echo $categoria['nm_categoria'] ?></td>
	    <td><?php echo $categoria->Categoria->nm_categoria ?></td>
	    <td><?php echo $categoria['ds_categoria'] ?></td>
	    <td><?php echo $categoria['slug'] ?></td>
		<td>
			<?php
            	echo link_to(
	                ' ',
	                url_for('categoria/edit?id_categoria='.$categoria['id_categoria']),
	                array('class'=>'icoEditar','title'=>'Editar categoria')
            	)
        	?>
    		<?php
            	echo link_to(
	                ' ',
	                url_for('categoria/delete?id_categoria='.$categoria['id_categoria']),
	                array('class'=>'icoExcluir','title'=>'Excluir categoria', 'confirm' => 'Tem certeza que deseja Excluir?')
	            )
        	?>
		</td>
    </tr>
    <?php endforeach; ?>
  </tbody>
</table>
</div>